﻿using UnityEngine;
using System.Collections;
using System.IO;

namespace Baiyy {
	public static class Config {

		/// <summary>
		/// 获取StreamAssets路径。
		/// </summary>
		/// <value>The stream assets path.</value>
		public static string streamAssetsPath {
			get { return Application.streamingAssetsPath.Replace("\\", "/"); }
		}

		/// <summary>
		/// 获取可写路径。
		/// </summary>
		/// <value>The writable path.</value>
		public static string writablePath {
			get { return Application.persistentDataPath.Replace("\\", "/"); }
		}

		/// <summary>
		/// 获取版本文件名字。
		/// </summary>
		/// <value>The name of the version file.</value>
		public static string versionFileName {
			get { return "version.json.bytes"; }
		}

		/// <summary>
		/// 获取本地版本文件路径。
		/// </summary>
		/// <value>The local version file path.</value>
		public static string localVersionFilePath {
			get {
				string dyPath = writablePath + "/" + versionFileName;
				if (File.Exists (dyPath)) {
					return dyPath;
				}
				return streamAssetsPath + "/" + versionFileName;
			}
		}
	}
}
